Use bookmark labels in the combobox.
authorMatthias Clasen <mclasen@redhat.com>
Sun, 17 Sep 2006 04:20:43 +0000 (04:20 +0000)
committerMatthias Clasen <matthiasc@src.gnome.org>
Sun, 17 Sep 2006 04:20:43 +0000 (04:20 +0000)
2006-09-17  Matthias Clasen  <mclasen@redhat.com>

* gtk/gtkfilechooserbutton.c: Use bookmark labels in
the combobox.

ChangeLog
gtk/gtkfilechooserbutton.c

index b4f1c985d5b2a6e7b43d4861d8908acb30f47cd7..4b486d22066e53259e59ba8806170990b686e301 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,8 @@
 2006-09-16  Matthias Clasen  <mclasen@redhat.com>
 
+       * gtk/gtkfilechooserbutton.c: Use bookmark labels in 
+       the combobox. 
+
        * gtk/gtkfilechooserbutton.c: Don't add remote volumes and 
        bookmarks to the model in local-only mode, to avoid 
        authentication dialogs pop up for invisible bookmarks, and
index e8ca3a4f8516c531f588d27b69e856302d132c59..b99274f0953aaf00c29f5c2a19e813b50302a7bc 100644 (file)
@@ -1386,6 +1386,7 @@ get_icon_theme (GtkWidget *widget)
 struct SetDisplayNameData
 {
   GtkFileChooserButton *button;
+  char *label;
   GtkTreeRowReference *row_ref;
 };
 
@@ -1432,9 +1433,12 @@ set_info_get_info_cb (GtkFileSystemHandle *handle,
   pixbuf = gtk_file_info_render_icon (info, GTK_WIDGET (data->button),
                                      data->button->priv->icon_size, NULL);
 
+  if (!data->label)
+    data->label = g_strdup (gtk_file_info_get_display_name (info));
+
   gtk_list_store_set (GTK_LIST_STORE (data->button->priv->model), &iter,
                      ICON_COLUMN, pixbuf,
-                     DISPLAY_NAME_COLUMN, gtk_file_info_get_display_name (info),
+                     DISPLAY_NAME_COLUMN, data->label,
                      IS_FOLDER_COLUMN, gtk_file_info_get_is_folder (info),
                      -1);
 
@@ -1443,6 +1447,7 @@ set_info_get_info_cb (GtkFileSystemHandle *handle,
 
 out:
   g_object_unref (data->button);
+  g_free (data->label);
   gtk_tree_row_reference_free (data->row_ref);
   g_free (data);
 
@@ -1461,6 +1466,8 @@ set_info_for_path_at_iter (GtkFileChooserButton *button,
   data = g_new0 (struct SetDisplayNameData, 1);
   data->button = g_object_ref (button);
 
+  data->label = gtk_file_system_get_bookmark_label (button->priv->fs, path);
+
   tree_path = gtk_tree_model_get_path (button->priv->model, iter);
   data->row_ref = gtk_tree_row_reference_new (button->priv->model, tree_path);
   gtk_tree_path_free (tree_path);